package com.chcplayer.ui
{
import flash.display.Sprite;

/**
 * author yh
 */
public class ColorCompare extends Sprite
{
	/**
	 */
	public static const OLD_COLOR_W:int = 48;
	/**
	 */
	public static const s_W:int = 100;
	/**
	 */
	public static const s_H:int = 35;
//--------------------------------------------------------------------------------------------------
// private
//--------------------------------------------------------------------------------------------------
	/**
	 */
	private var m_nNewC:int;
	/**
	 */
	private var m_nOldC:int;
	/**
	 */
	public function ColorCompare()
	{
	}
//--------------------------------------------------------------------------------------------------
// private
//--------------------------------------------------------------------------------------------------
	private function _update():void
	{
		this.graphics.clear();
		this.graphics.beginFill(0);
		this.graphics.drawRect(0, 0, s_W, s_H);
		var nW:int = s_W - 2;
		var nH:int = s_H - 2;
		this.graphics.drawRect(1, 1, nW, nH);
		graphics.beginFill(0xffFFff);
		graphics.drawRect(1, 1, nW, nH);
		nW -= 2;
		nH -= 2;
		graphics.drawRect(2, 2, nW, nH);
		this.graphics.beginFill(m_nOldC);
		this.graphics.drawRect(2, 2, OLD_COLOR_W, nH);
		this.graphics.beginFill(m_nNewC);
		nW = nW - OLD_COLOR_W;
		this.graphics.drawRect(OLD_COLOR_W+2, 2, nW, nH);
		this.graphics.endFill();
	}
//==================================================================================================
// public
//==================================================================================================
	public function setNewColor(nC:int):void
	{
		m_nNewC = nC;
		this._update();
	}
	/**
	 */
	public function setOldColor(nC:int):void
	{
		m_nOldC = nC;
		this._update();
	}
	/**
	 */
}
}